package cn.webrx;

import java.util.regex.Pattern;

public class Reg10 {
    public static void main(String[] args) {
        System.out.println("123".matches("\\d{3}"));
        System.out.println("   ".matches("\s{3}"));
        System.out.println("   ".matches(" {3}"));
        System.out.println("   ".matches("[\\s]{3}"));
        System.out.println("   ".matches("[ ]{3}"));

    }

    public static void abc(String[] args) {
        String tel = "1014577033";
        String p = "1[358]{3}\\d{9}"; //1 第二位 1 2 3 5
        System.out.println(tel.matches(p));


        //p2就是正则表达式，本质和 String p2 = "a-cxyz-"
        Pattern p2 = Pattern.compile("[a-cxyz-]{3}",Pattern.CASE_INSENSITIVE);
        System.out.println(p2.matcher("---").matches()); //true
    }
}
